md-toolbar {
  &.md-menu-toolbar {
    h2.md-toolbar-tools {
      line-height: 1rem;
      height: auto;
      padding: 3.5 * $baseline-grid;
      padding-bottom: 1.5 * $baseline-grid;
    }
  }

  // Used to allow hovering from one menu to the
  // next when inside of a toolbar.
  &.md-has-open-menu {
    position: relative;
    z-index: $z-index-menu;
  }
}

md-menu-bar {
  padding: 0 2.5 * $baseline-grid;
  display: block;
  position: relative;
  z-index: 2;
  .md-menu {
    display: inline-block;
    padding: 0;
    position: relative;
  }
  button {
    font-size: rem(1.4);
    padding: 0 1.25 * $baseline-grid;
    margin: 0;
    border: 0;
    background-color: transparent;
    height: 5 * $baseline-grid;
  }

  md-backdrop.md-menu-backdrop {
    z-index: -2;
  }
}

md-menu-content.md-menu-bar-menu.md-dense {
  max-height: none;
  padding: 2 * $baseline-grid 0;
  md-menu-item.md-indent {
    position: relative;
    > md-icon {
      position: absolute;
      padding: 0;
      width: 24px;
      top: 0.75 * $baseline-grid;
      @include rtl-prop(left, right, 3 * $baseline-grid, auto);
    }
    > .md-button, .md-menu > .md-button {
      @include rtl(padding, 0 4 * $baseline-grid 0 8 * $baseline-grid, 0 8 * $baseline-grid 0 4 * $baseline-grid);
    }
  }
  .md-button {
    min-height: 0;
    height: 4 * $baseline-grid;
    display: flex;
    span {
      flex-grow: 1;
    }
    span.md-alt-text {
      flex-grow: 0;
      align-self: flex-end;
      margin: 0 $baseline-grid;
    }
  }
  md-menu-divider {
    margin: $baseline-grid 0;
  }

  md-menu-item > .md-button, .md-menu > .md-button {
    @include rtl(text-align, left, right);
  }

  .md-menu {
    padding: 0;
    > .md-button {
      position: relative;
      margin: 0;
      width: 100%;
      text-transform: none;
      font-weight: normal;
      border-radius: 0px;
      @include rtl-prop(padding-left, padding-right, 2 * $baseline-grid, 0);
      &:after {
        display: block;
        content: '\25BC';
        position: absolute;
        top: 0px;
        speak: none;
        @include rtl(transform, rotate(270deg) scaleY(0.45) scaleX(0.9), rotate(90deg) scaleY(0.45) scaleX(0.9));
        @include rtl-prop(right, left, 3.5 * $baseline-grid, auto);
      }
    }
  }
}
